package cn.usbtg.common.idmanager.formater;

/**
 * 常量格式化器
 */
public class AutoIncrementFormater extends BasicFormater {
    protected int zz; //种子
    protected int zl; //增量
    private int num;//当前种子

    public AutoIncrementFormater() {
        this.zz = 0;
        this.zl = 1;
        this.num = zz;
    }

    public AutoIncrementFormater(int zz, int zl) {
        this.zz = zz;
        this.zl = zl;
        this.num = zz;
    }

    @Override
    public synchronized String next(Object... params) {
        num += zl;
        return last = String.valueOf(num);
    }

    public int getZz() {
        return zz;
    }

    public void setZz(int zz) {
        this.zz = zz;
    }

    public int getZl() {
        return zl;
    }

    public void setZl(int zl) {
        this.zl = zl;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
}